package com.leapp.sk.ui.activity.login

import android.content.Intent
import android.os.Bundle
import cn.jpush.android.api.JPushInterface
import com.example.mvp.activity.BaseActivityMVP
import com.example.mvp.binder.BaseDataBinder
import com.leapp.sk.app.SKApplication
import com.leapp.sk.binder.BaseBinder
import com.leapp.sk.viewdelegate.login.SplashScreenDlegate

/**
 * 闪屏页面
 * @author  chaohaipeng  on 2018/8/15.
 */
class SplashScreenActiity:BaseActivityMVP<SplashScreenDlegate>() {
    override fun initDate() {
        SKApplication.getInstance()?.mHandler?.postDelayed({
            val intent= Intent(this,LoginActivity::class.java)
            startActivity(intent)
            finish()
        }, 2500)
    }

    override fun bindEvenListener() {
    }

    override fun getDelegateClass(): Class<SplashScreenDlegate> {
        return SplashScreenDlegate::class.java
    }

    override fun getDataBinder(): BaseDataBinder<*, *> {
        return BaseBinder()
    }

    override fun initView(p0: Bundle?) {
    }


     override fun onResume() {
        super.onResume()
        try {
            JPushInterface.onResume(this)
        } catch (e: Exception) {
            e.printStackTrace()
        }

    }

     override fun onPause() {
        super.onPause()
        JPushInterface.onPause(this)
    }
}